#!/bin/bash
#This is vod backup
[ -d /data/vodbackup ]|| mkdir -p /data/vodbackup
/usr/local/mysql/bin/mysqldump  -h127.0.0.1  -udev -pdev2018918 -x --databases -R bestarmedia_node | gzip > /data/vodbackup/bestarmedia_node_V5_bak$(date +"%Y%m%d_%H%M%S").sql.gz
/usr/local/mysql/bin/mysqldump  -h127.0.0.1  -udev -pdev2018918 -x --databases -R bestarmedia_vod | gzip > /data/vodbackup/bestarmedia_vod_V5_bak$(date +"%Y%m%d_%H%M%S").sql.gz

#保留两份
find /data/vodbackup/ -mtime +2 -exec rm -rf {} \;
